package com.example.demo.Controller;

import com.example.demo.Bean.Coupon;
import com.example.demo.Bean.CouponParameter;
import com.example.demo.Service.PayBeforeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PayBeforeController {
    @Autowired
    private PayBeforeService payBeforeService;

    @GetMapping("/getAllCoupon")
    public List<Coupon> getAllCoupon(CouponParameter couponParameter){
        return payBeforeService.getAllCoupon(couponParameter);
    }

    @GetMapping("/getUserIntegral")
    public Integer getUserIntegral(String username){
        return payBeforeService.getIntegral(username);
    }
}
